home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK1.toast / Development Kits (Disc 1) / Interfaces & Libraries / Interfaces / CIncludes / QuickTimeMusic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-01  |  67.4 KB  |  1,499 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QuickTimeMusic.h
  3.  
  4.      Contains:    QuickTime interfaces
  5.  
  6.      Version:    Technology:    Technology:    QuickTime 2.5
  7.                  Package:    Universal Interfaces 2.1.3
  8.  
  9.      Copyright:    © 1984-1996 by Apple Computer, Inc.  All rights reserved.
  10.  
  11.      Bugs?:        If you find a problem with this file, send the file and version
  12.                  information (from above) and the problem description to:
  13.  
  14.                      Internet:    apple.bugs@applelink.apple.com
  15.                      AppleLink:    APPLE.BUGS
  16.  
  17. */
  18. #ifndef __QUICKTIMEMUSIC__
  19. #define __QUICKTIMEMUSIC__
  20.  
  21. #ifndef __COMPONENTS__
  22. #include <Components.h>
  23. #endif
  24. #ifndef __IMAGECOMPRESSION__
  25. #include <ImageCompression.h>
  26. #endif
  27. #ifndef __MOVIES__
  28. #include <Movies.h>
  29. #endif
  30. #ifndef __QUICKDRAW__
  31. #include <Quickdraw.h>
  32. #endif
  33. #ifndef __VIDEO__
  34. #include <Video.h>
  35. #endif
  36. #ifndef __MEMORY__
  37. #include <Memory.h>
  38. #endif
  39. #ifndef __SOUND__
  40. #include <Sound.h>
  41. #endif
  42.  
  43. #ifdef __cplusplus
  44. extern "C" {
  45. #endif
  46.  
  47. #if PRAGMA_IMPORT_SUPPORTED
  48. #pragma import on
  49. #endif
  50.  
  51. #if PRAGMA_ALIGN_SUPPORTED
  52. #pragma options align=mac68k
  53. #endif
  54.  
  55.  
  56. enum {
  57.     kaiToneDescType                = 'tone',
  58.     kaiNoteRequestInfoType        = 'ntrq',
  59.     kaiKnobListType                = 'knbl',
  60.     kaiKeyRangeInfoType            = 'sinf',
  61.     kaiSampleDescType            = 'sdsc',
  62.     kaiSampleDataType            = 'sdat',
  63.     kaiInstInfoType                = 'iinf',                        /*    kaiExtendedNameType        = 'name',*/
  64.     kaiPictType                    = 'pict',
  65.     kaiWriterType                = '©wrt',
  66.     kaiCopyrightType            = '©cpy',
  67.     kaiOtherStrType                = 'str '
  68. };
  69.  
  70. struct InstKnobRec {
  71.     long                             number;
  72.     long                             value;
  73. };
  74. typedef struct InstKnobRec InstKnobRec;
  75.  
  76.  
  77. enum {
  78.     kInstKnobMissingUnknown        = 0,
  79.     kInstKnobMissingDefault        = 1 << 0
  80. };
  81.  
  82. struct InstKnobList {
  83.     long                             knobCount;
  84.     long                             knobFlags;
  85.     InstKnobRec                     knob[1];
  86. };
  87. typedef struct InstKnobList InstKnobList;
  88.  
  89.  
  90. enum {
  91.     kMusicLoopTypeNormal        = 0,
  92.     kMusicLoopTypePalindrome    = 1                                /* back & forth*/
  93. };
  94.  
  95.  
  96. enum {
  97.     instSamplePreProcessFlag    = 1 << 0
  98. };
  99.  
  100. struct InstSampleDescRec {
  101.     OSType                             dataFormat;
  102.     short                             numChannels;
  103.     short                             sampleSize;
  104.     UnsignedFixed                     sampleRate;
  105.     short                             sampleDataID;
  106.     long                             offset;                        /* offset within SampleData - this could be just for internal use*/
  107.     long                             numSamples;                    /* this could also just be for internal use, we'll see*/
  108.  
  109.     long                             loopType;
  110.     long                             loopStart;
  111.     long                             loopEnd;
  112.  
  113.     long                             pitchNormal;
  114.     long                             pitchLow;
  115.     long                             pitchHigh;
  116. };
  117. typedef struct InstSampleDescRec InstSampleDescRec;
  118.  
  119. typedef Handle AtomicInstrument;
  120. typedef Ptr AtomicInstrumentPtr;
  121.  
  122. enum {
  123.     kMusicComponentType            = 'musi'
  124. };
  125.  
  126.  
  127. enum {
  128.     kSoftSynthComponentSubType    = 'ss  ',
  129.     kGMSynthComponentSubType    = 'gm  '
  130. };
  131.  
  132. typedef ComponentInstance MusicComponent;
  133. /* MusicSynthesizerFlags*/
  134.  
  135. enum {
  136.     kSynthesizerDynamicVoice    = 1,                            /* can assign voices on the fly (else, polyphony is very important */
  137.     kSynthesizerUsesMIDIPort    = 2,                            /* must be patched through MIDI Manager */
  138.     kSynthesizerMicrotone        = 4,                            /* can play microtonal scales */
  139.     kSynthesizerHasSamples        = 8,                            /* synthesizer has some use for sampled data */
  140.     kSynthesizerMixedDrums        = 16,                            /* any part can play drum parts, total = instrument parts */
  141.     kSynthesizerSoftware        = 32,                            /* implemented in main CPU software == uses cpu cycles */
  142.     kSynthesizerHardware        = 64,                            /* is a hardware device (such as nubus, or maybe DSP?) */
  143.     kSynthesizerDynamicChannel    = 128,                            /* can move any part to any channel or disable each part. (else we assume it lives on all channels in masks) */
  144.     kSynthesizerHogsSystemChannel = 256,                        /* can be channelwise dynamic, but always responds on its system channel */
  145.     kSynthesizerSlowSetPart        = 1024,                            /* SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes */
  146.     kSynthesizerOffline            = 4096,                            /* can enter an offline synthesis mode */
  147.     kSynthesizerGM                = 16384                            /* synth is a GM device */
  148. };
  149.  
  150. /*
  151.  * Note that these controller numbers
  152.  * are _not_ identical to the MIDI controller numbers.
  153.  * These are _signed_ 8.8 values, and the LSB's are
  154.  * always sent to a MIDI device. Controllers 32-63 are
  155.  * reserved (for MIDI, they are LSB's for 0-31, but we
  156.  * always send both).
  157.  *
  158.  * The full range, therefore, is -128.00 to 127.7f.
  159.  *
  160.  * _Excepting_ _volume_, all controls default to zero.
  161.  *
  162.  * Pitch bend is specified in fractional semitones! No
  163.  * more "pitch bend range" nonsense. You can bend as far
  164.  * as you want, any time you want.
  165. */
  166. typedef SInt32 MusicController;
  167.  
  168. enum {
  169.     kControllerModulationWheel    = 1,
  170.     kControllerBreath            = 2,
  171.     kControllerFoot                = 4,
  172.     kControllerPortamentoTime    = 5,                            /* portamento on/off is omitted, 0 time = 'off' */
  173.     kControllerVolume            = 7,
  174.     kControllerBalance            = 8,
  175.     kControllerPan                = 10,                            /* 0 - "default", 1 - n: positioned in output 1-n (incl fractions) */
  176.     kControllerExpression        = 11,
  177.     kControllerLever1            = 16,                            /* general purpose controllers */
  178.     kControllerLever2            = 17,                            /* general purpose controllers */
  179.     kControllerLever3            = 18,                            /* general purpose controllers */
  180.     kControllerLever4            = 19,                            /* general purpose controllers */
  181.     kControllerLever5            = 80,                            /* general purpose controllers */
  182.     kControllerLever6            = 81,                            /* general purpose controllers */
  183.     kControllerLever7            = 82,                            /* general purpose controllers */
  184.     kControllerLever8            = 83,                            /* general purpose controllers */
  185.     kControllerPitchBend        = 32,                            /* positive & negative semitones, with 7 bits fraction */
  186.     kControllerAfterTouch        = 33,                            /* aka channel pressure */
  187.     kControllerSustain            = 64,                            /* boolean - positive for on, 0 or negative off */
  188.     kControllerSostenuto        = 66,                            /* boolean */
  189.     kControllerSoftPedal        = 67,                            /* boolean */
  190.     kControllerReverb            = 91,
  191.     kControllerTremolo            = 92,
  192.     kControllerChorus            = 93,
  193.     kControllerCeleste            = 94,
  194.     kControllerPhaser            = 95,
  195.     kControllerEditPart            = 113,                            /* last 16 controllers 113-128 and above are global controllers which respond on part zero */
  196.     kControllerMasterTune        = 114
  197. };
  198.  
  199.  
  200. enum {
  201.     kControllerMaximum            = 0x7FFF,                        /* +01111111.11111111 */
  202.     kControllerMinimum            = 0x8000                        /* -10000000.00000000 */
  203. };
  204.  
  205. struct SynthesizerDescription {
  206.     OSType                             synthesizerType;            /* synthesizer type (must be same as component subtype) */
  207.     Str31                             name;                        /* text name of synthesizer type */
  208.     unsigned long                     flags;                        /* from the above enum */
  209.     unsigned long                     voiceCount;                    /* maximum polyphony */
  210.  
  211.     unsigned long                     partCount;                    /* maximum multi-timbrality (and midi channels) */
  212.     unsigned long                     instrumentCount;            /* non gm, built in (rom) instruments only */
  213.     unsigned long                     modifiableInstrumentCount;    /* plus n-more are user modifiable */
  214.     unsigned long                     channelMask;                /* (midi device only) which channels device always uses */
  215.  
  216.     unsigned long                     drumPartCount;                /* maximum multi-timbrality of drum parts */
  217.     unsigned long                     drumCount;                    /* non gm, built in (rom) drumkits only */
  218.     unsigned long                     modifiableDrumCount;        /* plus n-more are user modifiable */
  219.     unsigned long                     drumChannelMask;            /* (midi device only) which channels device always uses */
  220.  
  221.     unsigned long                     outputCount;                /* number of audio outputs (usually two) */
  222.     unsigned long                     latency;                    /* response time in µSec */
  223.  
  224.     unsigned long                     controllers[4];                /* array of 128 bits */
  225.     unsigned long                     gmInstruments[4];            /* array of 128 bits */
  226.     unsigned long                     gmDrums[4];                    /* array of 128 bits */
  227. };
  228. typedef struct SynthesizerDescription SynthesizerDescription;
  229.  
  230.  
  231. enum {
  232.     kVoiceCountDynamic            = -1                            /* constant to use to specify dynamic voicing */
  233. };
  234.  
  235. struct ToneDescription {
  236.     OSType                             synthesizerType;            /* synthesizer type */
  237.     Str31                             synthesizerName;            /* name of instantiation of synth */
  238.     Str31                             instrumentName;                /* preferred name for human use */
  239.     long                             instrumentNumber;            /* inst-number used if synth-name matches */
  240.     long                             gmNumber;                    /* Best matching general MIDI number */
  241. };
  242. typedef struct ToneDescription ToneDescription;
  243.  
  244.  
  245. enum {
  246.     kFirstDrumkit                = 16384,                        /* (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! */
  247.     kLastDrumkit                = (kFirstDrumkit + 128)
  248. };
  249.  
  250. /* InstrumentMatch*/
  251.  
  252. enum {
  253.     kInstrumentMatchSynthesizerType = 1,
  254.     kInstrumentMatchSynthesizerName = 2,
  255.     kInstrumentMatchName        = 4,
  256.     kInstrumentMatchNumber        = 8,
  257.     kInstrumentMatchGMNumber    = 16
  258. };
  259.  
  260. /* KnobFlags*/
  261.  
  262. enum {
  263.     kKnobReadOnly                = 16,                            /* knob value cannot be changed by user or with a SetKnob call */
  264.     kKnobInterruptUnsafe        = 32,                            /* only alter this knob from foreground task time (may access toolbox) */
  265.     kKnobKeyrangeOverride        = 64,                            /* knob can be overridden within a single keyrange (software synth only) */
  266.     kKnobGroupStart                = 128,                            /* knob is first in some logical group of knobs */
  267.     kKnobFixedPoint8            = 1024,
  268.     kKnobFixedPoint16            = 2048,                            /* One of these may be used at a time. */
  269.     kKnobTypeNumber                = 0 << 12,
  270.     kKnobTypeGroupName            = 1 << 12,                        /* "knob" is really a group name for display purposes */
  271.     kKnobTypeBoolean            = 2 << 12,                        /* if range is greater than 1, its a multi-checkbox field */
  272.     kKnobTypeNote                = 3 << 12,                        /* knob range is equivalent to MIDI keys */
  273.     kKnobTypePan                = 4 << 12,                        /* range goes left/right (lose this? ) */
  274.     kKnobTypeInstrument            = 5 << 12,                        /* knob value = reference to another instrument number */
  275.     kKnobTypeSetting            = 6 << 12,                        /* knob value is 1 of n different things (eg, fm algorithms) popup menu */
  276.     kKnobTypeMilliseconds        = 7 << 12,                        /* knob is a millisecond time range */
  277.     kKnobTypePercentage            = 8 << 12,                        /* knob range is displayed as a Percentage */
  278.     kKnobTypeHertz                = 9 << 12,                        /* knob represents frequency */
  279.     kKnobTypeButton                = 10 << 12                        /* momentary trigger push button */
  280. };
  281.  
  282.  
  283. enum {
  284.     kUnknownKnobValue            = 0x7FFFFFFF,                    /* a knob with this value means, we don't know it. */
  285.     kDefaultKnobValue            = 0x7FFFFFFE                    /* used to SET a knob to its default value. */
  286. };
  287.  
  288. struct KnobDescription {
  289.     Str63                             name;
  290.     long                             lowValue;
  291.     long                             highValue;
  292.     long                             defaultValue;                /* a default instrument is made of all default values */
  293.     long                             flags;
  294.     long                             knobID;
  295. };
  296. typedef struct KnobDescription KnobDescription;
  297.  
  298. struct GCInstrumentData {
  299.     ToneDescription                 tone;
  300.     long                             knobCount;
  301.     long                             knob[1];
  302. };
  303. typedef struct GCInstrumentData GCInstrumentData;
  304.  
  305. typedef GCInstrumentData *GCInstrumentDataPtr;
  306. typedef GCInstrumentDataPtr *GCInstrumentDataHandle;
  307. struct InstrumentAboutInfo {
  308.     PicHandle                         p;
  309.     Str255                             author;
  310.     Str255                             copyright;
  311.     Str255                             other;
  312. };
  313. typedef struct InstrumentAboutInfo InstrumentAboutInfo;
  314.  
  315.  
  316. enum {
  317.     kMusicPacketPortLost        = 1,                            /* received when application loses the default input port */
  318.     kMusicPacketPortFound        = 2,                            /* received when application gets it back out from under someone else's claim */
  319.     kMusicPacketTimeGap            = 3                                /* data[0] = number of milliseconds to keep the MIDI line silent */
  320. };
  321.  
  322. struct MusicMIDIPacket {
  323.     unsigned short                     length;
  324.     unsigned long                     reserved;                    /* if length zero, then reserved = above enum */
  325.     UInt8                             data[249];
  326. };
  327. typedef struct MusicMIDIPacket MusicMIDIPacket;
  328.  
  329. typedef pascal ComponentResult (*MusicMIDISendProcPtr)(MusicComponent self, long refCon, MusicMIDIPacket *mmp);
  330.  
  331. #if GENERATINGCFM
  332. typedef UniversalProcPtr MusicMIDISendUPP;
  333. #else
  334. typedef MusicMIDISendProcPtr MusicMIDISendUPP;
  335. #endif
  336. typedef pascal ComponentResult (*MusicMIDIReadHookProcPtr)(MusicMIDIPacket *mp, long myRefCon);
  337.  
  338. #if GENERATINGCFM
  339. typedef UniversalProcPtr MusicMIDIReadHookUPP;
  340. #else
  341. typedef MusicMIDIReadHookProcPtr MusicMIDIReadHookUPP;
  342. #endif
  343.  
  344. enum {
  345.     notImplementedMusicErr        = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))),
  346.     cantSendToSynthesizerErr    = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))),
  347.     cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))),
  348.     illegalVoiceAllocationErr    = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))),
  349.     illegalPartErr                = (0x80000000 | (0xFFFF & (illegalPartOSErr))),
  350.     illegalChannelErr            = (0x80000000 | (0xFFFF & (illegalChannelOSErr))),
  351.     illegalKnobErr                = (0x80000000 | (0xFFFF & (illegalKnobOSErr))),
  352.     illegalKnobValueErr            = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))),
  353.     illegalInstrumentErr        = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))),
  354.     illegalControllerErr        = (0x80000000 | (0xFFFF & (illegalControllerOSErr))),
  355.     midiManagerAbsentErr        = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))),
  356.     synthesizerNotRespondingErr    = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))),
  357.     synthesizerErr                = (0x80000000 | (0xFFFF & (synthesizerOSErr))),
  358.     illegalNoteChannelErr        = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))),
  359.     noteChannelNotAllocatedErr    = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))),
  360.     tunePlayerFullErr            = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))),
  361.     tuneParseErr                = (0x80000000 | (0xFFFF & (tuneParseOSErr)))
  362. };
  363.  
  364.  
  365. enum {
  366.     kGetAtomicInstNoExpandedSamples = 1 << 0,
  367.     kGetAtomicInstNoOriginalSamples = 1 << 1,
  368.     kGetAtomicInstNoSamples        = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOriginalSamples,
  369.     kGetAtomicInstNoKnobList    = 1 << 2,
  370.     kGetAtomicInstNoInstrumentInfo = 1 << 3,
  371.     kGetAtomicInstOriginalKnobList = 1 << 4,
  372.     kGetAtomicInstAllKnobs        = 1 << 5                        /* return even those that are set to default*/
  373. };
  374.  
  375. /*
  376.  For non-gm instruments, instrument number of tone description == 0
  377.  If you want to speed up while running, slam the inst num with what Get instrument number returns
  378.  All missing knobs are slammed to the default value
  379. */
  380.  
  381. enum {
  382.     kSetAtomicInstKeepOriginalInstrument = 1 << 0,
  383.     kSetAtomicInstShareAcrossParts = 1 << 1,                    /* inst disappears when app goes away*/
  384.     kSetAtomicInstCallerTosses    = 1 << 2,                        /* the caller isn't keeping a copy around (for NASetAtomicInstrument)*/
  385.     kSetAtomicInstDontPreprocess = 1 << 7                        /* perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic*/
  386. };
  387.  
  388.  
  389. enum {
  390.     kInstrumentNamesModifiable    = 1,
  391.     kInstrumentNamesBoth        = 2
  392. };
  393.  
  394.  
  395. enum {
  396.     kSetPartInstrumentNumberSafe = 0x40000000                    /* or'd with instrument number on MusicSetPartInstrumentNumber means we're calling at interrupt level (dont move RAM)*/
  397. };
  398.  
  399. /*
  400.  * Structures specific to the GenericMusicComponent
  401. */
  402.  
  403. enum {
  404.     kGenericMusicComponentSubtype = 'gene'
  405. };
  406.  
  407. struct GenericKnobDescription {
  408.     KnobDescription                 kd;
  409.     long                             hw1;                        /* driver defined */
  410.     long                             hw2;                        /* driver defined */
  411.     long                             hw3;                        /* driver defined */
  412.     long                             settingsID;                    /* resource ID list for boolean and popup names */
  413. };
  414. typedef struct GenericKnobDescription GenericKnobDescription;
  415.  
  416. struct GenericKnobDescriptionList {
  417.     long                             knobCount;
  418.     GenericKnobDescription             knob[1];
  419. };
  420. typedef struct GenericKnobDescriptionList GenericKnobDescriptionList;
  421.  
  422. typedef GenericKnobDescriptionList *GenericKnobDescriptionListPtr;
  423. typedef GenericKnobDescriptionListPtr *GenericKnobDescriptionListHandle;
  424. /* knobTypes for MusicDerivedSetKnob */
  425.  
  426. enum {
  427.     kGenericMusicKnob            = 1,
  428.     kGenericMusicInstrumentKnob    = 2,
  429.     kGenericMusicDrumKnob        = 3,
  430.     kGenericMusicGlobalController = 4
  431. };
  432.  
  433.  
  434. enum {
  435.     kGenericMusicResFirst        = 0,
  436.     kGenericMusicResMiscStringList = 1,                            /* STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother */
  437.     kGenericMusicResMiscLongList = 2,                            /* Long various params, see list below */
  438.     kGenericMusicResInstrumentList = 3,                            /* NmLs of names and shorts, categories prefixed by '••' */
  439.     kGenericMusicResDrumList    = 4,                            /* NmLs of names and shorts */
  440.     kGenericMusicResInstrumentKnobDescriptionList = 5,            /* Knob */
  441.     kGenericMusicResDrumKnobDescriptionList = 6,                /* Knob */
  442.     kGenericMusicResKnobDescriptionList = 7,                    /* Knob */
  443.     kGenericMusicResBitsLongList = 8,                            /* Long back to back bitmaps of controllers, gminstruments, and drums */
  444.     kGenericMusicResModifiableInstrumentHW = 9,                    /* Shrt same as the hw shorts trailing the instrument names, a shortlist */
  445.     kGenericMusicResGMTranslation = 10,                            /* Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers) */
  446.     kGenericMusicResROMInstrumentData = 11,                        /* knob lists for ROM instruments, so the knob values may be known */
  447.     kGenericMusicResAboutPICT    = 12,                            /* picture for aboutlist. must be present for GetAbout call to work */
  448.     kGenericMusicResLast        = 13
  449. };
  450.  
  451. /* elements of the misc long list */
  452.  
  453. enum {
  454.     kGenericMusicMiscLongFirst    = 0,
  455.     kGenericMusicMiscLongVoiceCount = 1,
  456.     kGenericMusicMiscLongPartCount = 2,
  457.     kGenericMusicMiscLongModifiableInstrumentCount = 3,
  458.     kGenericMusicMiscLongChannelMask = 4,
  459.     kGenericMusicMiscLongDrumPartCount = 5,
  460.     kGenericMusicMiscLongModifiableDrumCount = 6,
  461.     kGenericMusicMiscLongDrumChannelMask = 7,
  462.     kGenericMusicMiscLongOutputCount = 8,
  463.     kGenericMusicMiscLongLatency = 9,
  464.     kGenericMusicMiscLongFlags    = 10,
  465.     kGenericMusicMiscLongFirstGMHW = 11,                        /* number to add to locate GM main instruments */
  466.     kGenericMusicMiscLongFirstGMDrumHW = 12,                    /* number to add to locate GM drumkits */
  467.     kGenericMusicMiscLongFirstUserHW = 13,                        /* First hw number of user instruments (presumed sequential) */
  468.     kGenericMusicMiscLongLast    = 14
  469. };
  470.  
  471. struct GCPart {
  472.     long                             hwInstrumentNumber;            /* internal number of recalled instrument */
  473.     short                             controller[128];            /* current values for all controllers */
  474.     long                             volume;                        /* ctrl 7 is special case */
  475.     long                             polyphony;
  476.     long                             midiChannel;                /* 1-16 if in use */
  477.     GCInstrumentData                 id;                            /* ToneDescription & knoblist, uncertain length */
  478. };
  479. typedef struct GCPart GCPart;
  480.  
  481. /*
  482.  * Calls specific to the GenericMusicComponent
  483. */
  484.  
  485. enum {
  486.     kMusicGenericRange            = 0x0100,
  487.     kMusicDerivedRange            = 0x0200
  488. };
  489.  
  490. /*
  491.  * Flags in GenericMusicConfigure call
  492. */
  493.  
  494. enum {
  495.     kGenericMusicDoMIDI            = 1 << 0,                        /* implement normal MIDI messages for note, controllers, and program changes 0-127 */
  496.     kGenericMusicBank0            = 1 << 1,                        /* implement instrument bank changes on controller 0 */
  497.     kGenericMusicBank32            = 1 << 2,                        /* implement instrument bank changes on controller 32 */
  498.     kGenericMusicErsatzMIDI        = 1 << 3,                        /* construct MIDI packets, but send them to the derived component */
  499.     kGenericMusicCallKnobs        = 1 << 4,                        /* call the derived component with special knob format call */
  500.     kGenericMusicCallParts        = 1 << 5,                        /* call the derived component with special part format call */
  501.     kGenericMusicCallInstrument    = 1 << 6,                        /* call MusicDerivedSetInstrument for MusicSetInstrument calls */
  502.     kGenericMusicCallNumber        = 1 << 7,                        /* call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff */
  503.     kGenericMusicCallROMInstrument = 1 << 8,                    /* call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource */
  504.     kGenericMusicAllDefaults    = 1 << 9                        /* indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules */
  505. };
  506.  
  507. typedef pascal ComponentResult (*MusicOfflineDataProcPtr)(Ptr SoundData, long numBytes, long myRefCon);
  508.  
  509. #if GENERATINGCFM
  510. typedef UniversalProcPtr MusicOfflineDataUPP;
  511. #else
  512. typedef MusicOfflineDataProcPtr MusicOfflineDataUPP;
  513. #endif
  514. struct OfflineSampleType {
  515.     unsigned long                     numChannels;                /*number of channels,  ie mono = 1*/
  516.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  517.     unsigned short                     sampleSize;                    /*number of bits in sample*/
  518. };
  519. typedef struct OfflineSampleType OfflineSampleType;
  520.  
  521. struct InstrumentInfoRecord {
  522.     long                             instrumentNumber;            /* instrument number (if 0, name is a catagory)*/
  523.     long                             flags;                        /* show in picker, etc.*/
  524.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  525.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  526. };
  527. typedef struct InstrumentInfoRecord InstrumentInfoRecord;
  528.  
  529. struct InstrumentInfoList {
  530.     long                             recordCount;
  531.     Handle                             toneNames;                    /* name from tone description*/
  532.     QTAtomContainer                 itxtNames;                    /* itxt/name atoms for instruments*/
  533.     InstrumentInfoRecord             info[1];
  534. };
  535. typedef struct InstrumentInfoList InstrumentInfoList;
  536.  
  537. typedef InstrumentInfoList *InstrumentInfoListPtr;
  538. typedef InstrumentInfoListPtr *InstrumentInfoListHandle;
  539. extern pascal ComponentResult MusicGetDescription(MusicComponent mc, SynthesizerDescription *sd)
  540.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  541.  
  542. extern pascal ComponentResult MusicGetPart(MusicComponent mc, long part, long *midiChannel, long *polyphony)
  543.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  544.  
  545. extern pascal ComponentResult MusicSetPart(MusicComponent mc, long part, long midiChannel, long polyphony)
  546.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  547.  
  548. extern pascal ComponentResult MusicSetPartInstrumentNumber(MusicComponent mc, long part, long instrumentNumber)
  549.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  550.  
  551. #if OLDROUTINENAMES
  552. #define MusicSetInstrumentNumber(ci,part,instrumentNumber) MusicSetPartInstrumentNumber(ci, part,instrumentNumber)
  553. #endif
  554. extern pascal ComponentResult MusicGetPartInstrumentNumber(MusicComponent mc, long part)
  555.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  556.  
  557. extern pascal ComponentResult MusicStorePartInstrument(MusicComponent mc, long part, long instrumentNumber)
  558.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  559.  
  560. extern pascal ComponentResult MusicGetPartAtomicInstrument(MusicComponent mc, long part, AtomicInstrument *ai, long flags)
  561.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0009, 0x7000, 0xA82A);
  562.  
  563. extern pascal ComponentResult MusicSetPartAtomicInstrument(MusicComponent mc, long part, AtomicInstrumentPtr aiP, long flags)
  564.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000A, 0x7000, 0xA82A);
  565.  
  566. /* Obsolete calls*/
  567. extern pascal ComponentResult MusicGetInstrumentKnobDescriptionObsolete(MusicComponent mc, long knobIndex, void *mkd)
  568.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
  569.  
  570. extern pascal ComponentResult MusicGetDrumKnobDescriptionObsolete(MusicComponent mc, long knobIndex, void *mkd)
  571.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000E, 0x7000, 0xA82A);
  572.  
  573. extern pascal ComponentResult MusicGetKnobDescriptionObsolete(MusicComponent mc, long knobIndex, void *mkd)
  574.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  575.  
  576. extern pascal ComponentResult MusicGetPartKnob(MusicComponent mc, long part, long knobID)
  577.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  578.  
  579. extern pascal ComponentResult MusicSetPartKnob(MusicComponent mc, long part, long knobID, long knobValue)
  580.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  581.  
  582. extern pascal ComponentResult MusicGetKnob(MusicComponent mc, long knobID)
  583.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  584.  
  585. extern pascal ComponentResult MusicSetKnob(MusicComponent mc, long knobID, long knobValue)
  586.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  587.  
  588. extern pascal ComponentResult MusicGetPartName(MusicComponent mc, long part, StringPtr name)
  589.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0014, 0x7000, 0xA82A);
  590.  
  591. extern pascal ComponentResult MusicSetPartName(MusicComponent mc, long part, StringPtr name)
  592.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  593.  
  594. extern pascal ComponentResult MusicFindTone(MusicComponent mc, ToneDescription *td, long *instrumentNumber, unsigned long *fit)
  595.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0016, 0x7000, 0xA82A);
  596.  
  597. extern pascal ComponentResult MusicPlayNote(MusicComponent mc, long part, long pitch, long velocity)
  598.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  599.  
  600. extern pascal ComponentResult MusicResetPart(MusicComponent mc, long part)
  601.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  602.  
  603. extern pascal ComponentResult MusicSetPartController(MusicComponent mc, long part, MusicController controllerNumber, long controllerValue)
  604.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  605.  
  606. #if OLDROUTINENAMES
  607. #define MusicSetController(ci,part,controllerNumber,controllerValue) MusicSetPartController(ci, part,controllerNumber,controllerValue)
  608. #endif
  609. extern pascal ComponentResult MusicGetPartController(MusicComponent mc, long part, MusicController controllerNumber)
  610.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  611.  
  612. extern pascal ComponentResult MusicGetMIDIProc(MusicComponent mc, MusicMIDISendUPP *midiSendProc, long *refCon)
  613.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  614.  
  615. extern pascal ComponentResult MusicSetMIDIProc(MusicComponent mc, MusicMIDISendUPP midiSendProc, long refCon)
  616.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  617.  
  618. extern pascal ComponentResult MusicGetInstrumentNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNames, Handle *instrumentCategoryLasts, Handle *instrumentCategoryNames)
  619.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  620.  
  621. extern pascal ComponentResult MusicGetDrumNames(MusicComponent mc, long modifiableInstruments, Handle *instrumentNumbers, Handle *instrumentNames)
  622.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x001E, 0x7000, 0xA82A);
  623.  
  624. extern pascal ComponentResult MusicGetMasterTune(MusicComponent mc)
  625.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x001F, 0x7000, 0xA82A);
  626.  
  627. extern pascal ComponentResult MusicSetMasterTune(MusicComponent mc, long masterTune)
  628.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  629.  
  630. extern pascal ComponentResult MusicGetInstrumentAboutInfo(MusicComponent mc, long part, InstrumentAboutInfo *iai)
  631.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  632.  
  633. extern pascal ComponentResult MusicGetDeviceConnection(MusicComponent mc, long index, long *id1, long *id2)
  634.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0023, 0x7000, 0xA82A);
  635.  
  636. extern pascal ComponentResult MusicUseDeviceConnection(MusicComponent mc, long id1, long id2)
  637.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  638.  
  639. extern pascal ComponentResult MusicGetKnobSettingStrings(MusicComponent mc, long knobIndex, long isGlobal, Handle *settingsNames, Handle *settingsCategoryLasts, Handle *settingsCategoryNames)
  640.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0025, 0x7000, 0xA82A);
  641.  
  642. extern pascal ComponentResult MusicGetMIDIPorts(MusicComponent mc, long *inputPortCount, long *outputPortCount)
  643.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0026, 0x7000, 0xA82A);
  644.  
  645. extern pascal ComponentResult MusicSendMIDI(MusicComponent mc, long portIndex, MusicMIDIPacket *mp)
  646.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0027, 0x7000, 0xA82A);
  647.  
  648. extern pascal ComponentResult MusicReceiveMIDI(MusicComponent mc, MusicMIDIReadHookUPP readHook, long refCon)
  649.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0028, 0x7000, 0xA82A);
  650.  
  651. extern pascal ComponentResult MusicStartOffline(MusicComponent mc, unsigned long *numChannels, UnsignedFixed *sampleRate, unsigned short *sampleSize, MusicOfflineDataUPP dataProc, long dataProcRefCon)
  652.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0029, 0x7000, 0xA82A);
  653.  
  654. extern pascal ComponentResult MusicSetOfflineTimeTo(MusicComponent mc, long newTimeStamp)
  655.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  656.  
  657. extern pascal ComponentResult MusicGetInstrumentKnobDescription(MusicComponent mc, long knobIndex, KnobDescription *mkd)
  658.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  659.  
  660. extern pascal ComponentResult MusicGetDrumKnobDescription(MusicComponent mc, long knobIndex, KnobDescription *mkd)
  661.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  662.  
  663. extern pascal ComponentResult MusicGetKnobDescription(MusicComponent mc, long knobIndex, KnobDescription *mkd)
  664.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002D, 0x7000, 0xA82A);
  665.  
  666. extern pascal ComponentResult MusicGetInfoText(MusicComponent mc, long selector, Handle *textH, Handle *styleH)
  667.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x002E, 0x7000, 0xA82A);
  668.  
  669. extern pascal ComponentResult MusicGetInstrumentInfo(MusicComponent mc, long getInstrumentNamesFlags, InstrumentInfoListHandle *infoListH)
  670.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002F, 0x7000, 0xA82A);
  671.  
  672. extern pascal ComponentResult MusicTask(MusicComponent mc)
  673.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0031, 0x7000, 0xA82A);
  674.  
  675. extern pascal ComponentResult MusicGenericConfigure(MusicComponent mc, long mode, long flags, long baseResID)
  676.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  677.  
  678. extern pascal ComponentResult MusicGenericGetPart(MusicComponent mc, long partNumber, GCPart **part)
  679.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0101, 0x7000, 0xA82A);
  680.  
  681. extern pascal ComponentResult MusicGenericGetKnobList(MusicComponent mc, long knobType, GenericKnobDescriptionListHandle *gkdlH)
  682.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0102, 0x7000, 0xA82A);
  683.  
  684. extern pascal ComponentResult MusicDerivedMIDISend(MusicComponent mc, MusicMIDIPacket *packet)
  685.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  686.  
  687. extern pascal ComponentResult MusicDerivedSetKnob(MusicComponent mc, long knobType, long knobNumber, long knobValue, long partNumber, GCPart *p, GenericKnobDescription *gkd)
  688.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0201, 0x7000, 0xA82A);
  689.  
  690. extern pascal ComponentResult MusicDerivedSetPart(MusicComponent mc, long partNumber, GCPart *p)
  691.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0202, 0x7000, 0xA82A);
  692.  
  693. extern pascal ComponentResult MusicDerivedSetInstrument(MusicComponent mc, long partNumber, GCPart *p)
  694.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0203, 0x7000, 0xA82A);
  695.  
  696. extern pascal ComponentResult MusicDerivedSetPartInstrumentNumber(MusicComponent mc, long partNumber, GCPart *p)
  697.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0204, 0x7000, 0xA82A);
  698.  
  699. extern pascal ComponentResult MusicDerivedSetMIDI(MusicComponent mc, MusicMIDISendProcPtr midiProc, long refcon, long midiChannel)
  700.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0205, 0x7000, 0xA82A);
  701.  
  702. extern pascal ComponentResult MusicDerivedStorePartInstrument(MusicComponent mc, long partNumber, GCPart *p, long instrumentNumber)
  703.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0206, 0x7000, 0xA82A);
  704.  
  705. /* Mask bit for returned value by InstrumentFind.*/
  706.  
  707. enum {
  708.     kInstrumentExactMatch        = 0x00020000,
  709.     kInstrumentRecommendedSubstitute = 0x00010000,
  710.     kInstrumentQualityField        = 0xFF000000,
  711.     kInstrumentRoland8BitQuality = 0x05000000
  712. };
  713.  
  714. typedef InstrumentAboutInfo *InstrumentAboutInfoPtr;
  715. typedef InstrumentAboutInfoPtr *InstrumentAboutInfoHandle;
  716. struct GMInstrumentInfo {
  717.     long                             cmpInstID;
  718.     long                             gmInstNum;
  719.     long                             instMatch;
  720. };
  721. typedef struct GMInstrumentInfo GMInstrumentInfo;
  722.  
  723. typedef GMInstrumentInfo *GMInstrumentInfoPtr;
  724. typedef GMInstrumentInfoPtr *GMInstrumentInfoHandle;
  725. struct nonGMInstrumentInfoRecord {
  726.     long                             cmpInstID;                    /* if 0, category name*/
  727.     long                             flags;                        /* match, show in picker*/
  728.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  729.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  730. };
  731. typedef struct nonGMInstrumentInfoRecord nonGMInstrumentInfoRecord;
  732.  
  733. struct nonGMInstrumentInfo {
  734.     long                             recordCount;
  735.     Handle                             toneNames;                    /* name from tone description*/
  736.     QTAtomContainer                 itxtNames;                    /* itext/name atoms for instruments*/
  737.     nonGMInstrumentInfoRecord         instInfo[1];
  738. };
  739. typedef struct nonGMInstrumentInfo nonGMInstrumentInfo;
  740.  
  741. typedef nonGMInstrumentInfo *nonGMInstrumentInfoPtr;
  742. typedef nonGMInstrumentInfoPtr *nonGMInstrumentInfoHandle;
  743. struct InstCompInfo {
  744.     long                             infoSize;                    /* size of this record*/
  745.     long                             GMinstrumentCount;
  746.     GMInstrumentInfoHandle             GMinstrumentInfo;
  747.     long                             GMdrumCount;
  748.     GMInstrumentInfoHandle             GMdrumInfo;
  749.     long                             nonGMinstrumentCount;
  750.     nonGMInstrumentInfoHandle         nonGMinstrumentInfo;
  751.     long                             nonGMdrumCount;
  752.     nonGMInstrumentInfoHandle         nonGMdrumInfo;
  753. };
  754. typedef struct InstCompInfo InstCompInfo;
  755.  
  756. typedef InstCompInfo *InstCompInfoPtr;
  757. typedef InstCompInfoPtr *InstCompInfoHandle;
  758. extern pascal ComponentResult InstrumentGetInst(ComponentInstance ci, long instID, AtomicInstrument *atomicInst, long flags)
  759.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0001, 0x7000, 0xA82A);
  760.  
  761. extern pascal ComponentResult InstrumentGetInfo(ComponentInstance ci, InstCompInfoHandle *instInfo)
  762.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0002, 0x7000, 0xA82A);
  763.  
  764. extern pascal ComponentResult InstrumentInitialize(ComponentInstance ci, long initFormat, void *initParams)
  765.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  766.  
  767. extern pascal ComponentResult InstrumentOpenComponentResFile(ComponentInstance ci, short *resFile)
  768.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  769.  
  770. extern pascal ComponentResult InstrumentCloseComponentResFile(ComponentInstance ci, short resFile)
  771.  FIVEWORDINLINE(0x2F3C, 0x0002, 0x0005, 0x7000, 0xA82A);
  772.  
  773. extern pascal ComponentResult InstrumentGetComponentRefCon(ComponentInstance ci, void **refCon)
  774.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  775.  
  776. extern pascal ComponentResult InstrumentSetComponentRefCon(ComponentInstance ci, void *refCon)
  777.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  778.  
  779. /*
  780. --------------------------
  781.     Types
  782. --------------------------
  783. */
  784.  
  785. enum {
  786.     kSynthesizerConnectionMono    = 1,                            /* if set, and synth can be mono/poly, then the partCount channels from the system channel are hogged */
  787.     kSynthesizerConnectionMMgr    = 2,                            /* this connection imported from the MIDI Mgr */
  788.     kSynthesizerConnectionOMS    = 4,                            /* this connection imported from OMS */
  789.     kSynthesizerConnectionQT    = 8,                            /* this connection is a QuickTime-only port */
  790.     kSynthesizerConnectionFMS    = 16                            /* this connection imported from FMS */
  791. };
  792.  
  793. /* used for MIDI device only */
  794. struct SynthesizerConnections {
  795.     OSType                             clientID;
  796.     OSType                             inputPortID;                /* terminology death: this port is used to SEND to the midi synth */
  797.     OSType                             outputPortID;                /* terminology death: this port receives from a keyboard or other control device */
  798.     long                             midiChannel;                /* The system channel; others are configurable (or the nubus slot number) */
  799.     long                             flags;
  800.     long                             unique;                        /* unique id may be used instead of index, to getinfo and unregister calls */
  801.     long                             reserved1;                    /* should be zero */
  802.     long                             reserved2;                    /* should be zero */
  803. };
  804. typedef struct SynthesizerConnections SynthesizerConnections;
  805.  
  806. struct QTMIDIPort {
  807.     SynthesizerConnections             portConnections;
  808.     Str63                             portName;
  809. };
  810. typedef struct QTMIDIPort QTMIDIPort;
  811.  
  812.  
  813. enum {
  814.     kNoteRequestNoGM            = 1,                            /* dont degrade to a GM synth */
  815.     kNoteRequestNoSynthType        = 2                                /* dont degrade to another synth of same type but different name */
  816. };
  817.  
  818. typedef ComponentInstance NoteAllocator;
  819. struct NoteRequestInfo {
  820.     UInt8                             flags;                        /* 1: dont accept GM match, 2: dont accept same-synth-type match */
  821.     UInt8                             reserved;                    /* must be zero */
  822.     short                             polyphony;                    /* Maximum number of voices */
  823.     Fixed                             typicalPolyphony;            /* Hint for level mixing */
  824. };
  825. typedef struct NoteRequestInfo NoteRequestInfo;
  826.  
  827. struct NoteRequest {
  828.     NoteRequestInfo                 info;
  829.     ToneDescription                 tone;
  830. };
  831. typedef struct NoteRequest NoteRequest;
  832.  
  833. typedef struct OpaqueNoteChannel* NoteChannel;
  834.  
  835. enum {
  836.     kPickDontMix                = 1,                            /* dont mix instruments with drum sounds */
  837.     kPickSameSynth                = 2,                            /* only allow the same device that went in, to come out */
  838.     kPickUserInsts                = 4,                            /* show user insts in addition to ROM voices */
  839.     kPickEditAllowEdit            = 8,                            /* lets user switch over to edit mode */
  840.     kPickEditAllowPick            = 16,                            /* lets the user switch over to pick mode */
  841.     kPickEditSynthGlobal        = 32,                            /* edit the global knobs of the synth */
  842.     kPickEditControllers        = 64                            /* edit the controllers of the notechannel */
  843. };
  844.  
  845.  
  846. enum {
  847.     kNoteAllocatorComponentType    = 'nota'
  848. };
  849.  
  850. struct NAStatPiece {
  851.     Str31                             clientName;
  852.     Str31                             synthesizerName;
  853.     long                             part;
  854.     long                             midiChannel;
  855.     long                             polyphony;
  856.     long                             valid;
  857.     NoteChannel                     nc;
  858. };
  859. typedef struct NAStatPiece NAStatPiece;
  860.  
  861. struct NAStat {
  862.     long                             pieceCount;
  863.     NAStatPiece                     piece[64];
  864. };
  865. typedef struct NAStat NAStat;
  866.  
  867. /*
  868. --------------------------------
  869.     Note Allocator Prototypes
  870. --------------------------------
  871. */
  872. extern pascal ComponentResult NARegisterMusicDevice(NoteAllocator ci, OSType synthType, Str31 name, SynthesizerConnections *connections)
  873.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0000, 0x7000, 0xA82A);
  874.  
  875. extern pascal ComponentResult NAUnregisterMusicDevice(NoteAllocator ci, long index)
  876.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  877.  
  878. extern pascal ComponentResult NAGetRegisteredMusicDevice(NoteAllocator ci, long index, OSType *synthType, Str31 name, SynthesizerConnections *connections, MusicComponent *mc)
  879.  FIVEWORDINLINE(0x2F3C, 0x0014, 0x0002, 0x7000, 0xA82A);
  880.  
  881. extern pascal ComponentResult NASaveMusicConfiguration(NoteAllocator ci)
  882.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  883.  
  884. extern pascal ComponentResult NANewNoteChannel(NoteAllocator ci, NoteRequest *noteRequest, NoteChannel *outChannel)
  885.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  886.  
  887. extern pascal ComponentResult NADisposeNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  888.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  889.  
  890. extern pascal ComponentResult NAGetNoteChannelInfo(NoteAllocator ci, NoteChannel noteChannel, long *index, long *part)
  891.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  892.  
  893. extern pascal ComponentResult NAPrerollNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  894.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  895.  
  896. extern pascal ComponentResult NAUnrollNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  897.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  898.  
  899. extern pascal ComponentResult NASetNoteChannelVolume(NoteAllocator ci, NoteChannel noteChannel, Fixed volume)
  900.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  901.  
  902. extern pascal ComponentResult NAResetNoteChannel(NoteAllocator ci, NoteChannel noteChannel)
  903.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  904.  
  905. extern pascal ComponentResult NAPlayNote(NoteAllocator ci, NoteChannel noteChannel, long pitch, long velocity)
  906.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000D, 0x7000, 0xA82A);
  907.  
  908. extern pascal ComponentResult NASetController(NoteAllocator ci, NoteChannel noteChannel, long controllerNumber, long controllerValue)
  909.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  910.  
  911. extern pascal ComponentResult NASetKnob(NoteAllocator ci, NoteChannel noteChannel, long knobNumber, long knobValue)
  912.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  913.  
  914. extern pascal ComponentResult NAFindNoteChannelTone(NoteAllocator ci, NoteChannel noteChannel, ToneDescription *td, long *instrumentNumber)
  915.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  916.  
  917. extern pascal ComponentResult NASetInstrumentNumber(NoteAllocator ci, NoteChannel noteChannel, long instrumentNumber)
  918.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0011, 0x7000, 0xA82A);
  919.  
  920. #if OLDROUTINENAMES
  921. #define NASetNoteChannelInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  922. #define NASetInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  923. #endif
  924. extern pascal ComponentResult NAPickInstrument(NoteAllocator ci, ModalFilterUPP filterProc, StringPtr prompt, ToneDescription *sd, unsigned long flags, long refCon, long reserved1, long reserved2)
  925.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x0012, 0x7000, 0xA82A);
  926.  
  927. extern pascal ComponentResult NAPickArrangement(NoteAllocator ci, ModalFilterUPP filterProc, StringPtr prompt, long zero1, long zero2, Track t, StringPtr songName)
  928.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0013, 0x7000, 0xA82A);
  929.  
  930. extern pascal ComponentResult NAGetStatusBlock(NoteAllocator ci, NAStat *stat)
  931.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0014, 0x7000, 0xA82A);
  932.  
  933. extern pascal ComponentResult NASetDefaultMIDIInput(NoteAllocator ci, SynthesizerConnections *sc)
  934.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  935.  
  936. extern pascal ComponentResult NAGetDefaultMIDIInput(NoteAllocator ci, SynthesizerConnections *sc)
  937.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0016, 0x7000, 0xA82A);
  938.  
  939. extern pascal ComponentResult NAUseDefaultMIDIInput(NoteAllocator ci, MusicMIDIReadHookUPP readHook, long refCon, unsigned long flags)
  940.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  941.  
  942. extern pascal ComponentResult NALoseDefaultMIDIInput(NoteAllocator ci)
  943.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x001A, 0x7000, 0xA82A);
  944.  
  945. extern pascal ComponentResult NAStuffToneDescription(NoteAllocator ci, long gmNumber, ToneDescription *td)
  946.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  947.  
  948. extern pascal ComponentResult NACopyrightDialog(NoteAllocator ci, PicHandle p, StringPtr author, StringPtr copyright, StringPtr other, StringPtr title, ModalFilterUPP filterProc, long refCon)
  949.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x001C, 0x7000, 0xA82A);
  950.  
  951. extern pascal ComponentResult NAGetMIDIPorts(NoteAllocator ci, Handle *inputPorts, Handle *outputPorts)
  952.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  953.  
  954. extern pascal ComponentResult NAGetNoteRequest(NoteAllocator ci, NoteChannel noteChannel, NoteRequest *nrOut)
  955.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  956.  
  957. extern pascal ComponentResult NASendMIDI(NoteAllocator ci, NoteChannel noteChannel, MusicMIDIPacket *mp)
  958.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0023, 0x7000, 0xA82A);
  959.  
  960. extern pascal ComponentResult NAPickEditInstrument(NoteAllocator ci, ModalFilterUPP filterProc, StringPtr prompt, long refCon, NoteChannel nc, AtomicInstrument ai, long flags)
  961.  FIVEWORDINLINE(0x2F3C, 0x0018, 0x0024, 0x7000, 0xA82A);
  962.  
  963. extern pascal ComponentResult NANewNoteChannelFromAtomicInstrument(NoteAllocator ci, AtomicInstrumentPtr instrument, long flags, NoteChannel *outChannel)
  964.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0025, 0x7000, 0xA82A);
  965.  
  966. extern pascal ComponentResult NASetAtomicInstrument(NoteAllocator ci, NoteChannel noteChannel, AtomicInstrumentPtr instrument, long flags)
  967.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0026, 0x7000, 0xA82A);
  968.  
  969. extern pascal ComponentResult NAGetKnob(NoteAllocator ci, NoteChannel noteChannel, long knobNumber, long *knobValue)
  970.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0028, 0x7000, 0xA82A);
  971.  
  972. extern pascal ComponentResult NATask(NoteAllocator ci)
  973.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0029, 0x7000, 0xA82A);
  974.  
  975. extern pascal ComponentResult NASetNoteChannelBalance(NoteAllocator ci, NoteChannel noteChannel, long balance)
  976.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x002A, 0x7000, 0xA82A);
  977.  
  978.  
  979. enum {
  980.     kTuneQueueDepth                = 8                                /* Deepest you can queue tune segments */
  981. };
  982.  
  983. struct TuneStatus {
  984.     unsigned long *                    tune;                        /* currently playing tune */
  985.     unsigned long *                    tunePtr;                    /* position within currently playing piece */
  986.     TimeValue                         time;                        /* current tune time */
  987.     short                             queueCount;                    /* how many pieces queued up? */
  988.     short                             queueSpots;                    /* How many more tunepieces can be queued */
  989.     TimeValue                         queueTime;                    /* How much time is queued up? (can be very inaccurate) */
  990.     long                             reserved[3];
  991. };
  992. typedef struct TuneStatus TuneStatus;
  993.  
  994. typedef pascal void (*TuneCallBackProcPtr)(const TuneStatus *status, long refCon);
  995. typedef pascal void (*TunePlayCallBackProcPtr)(unsigned long *event, long seed, long refCon);
  996.  
  997. #if GENERATINGCFM
  998. typedef UniversalProcPtr TuneCallBackUPP;
  999. typedef UniversalProcPtr TunePlayCallBackUPP;
  1000. #else
  1001. typedef TuneCallBackProcPtr TuneCallBackUPP;
  1002. typedef TunePlayCallBackProcPtr TunePlayCallBackUPP;
  1003. #endif
  1004. typedef ComponentInstance TunePlayer;
  1005.  
  1006. enum {
  1007.     kMaxTunePlayerParts            = 48,
  1008.     kTunePlayerType                = 'tune'
  1009. };
  1010.  
  1011. extern pascal ComponentResult TuneSetHeader(TunePlayer tp, unsigned long *header)
  1012.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1013.  
  1014. extern pascal ComponentResult TuneGetTimeBase(TunePlayer tp, TimeBase *tb)
  1015.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1016.  
  1017. extern pascal ComponentResult TuneSetTimeScale(TunePlayer tp, TimeScale scale)
  1018.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1019.  
  1020. extern pascal ComponentResult TuneGetTimeScale(TunePlayer tp, TimeScale *scale)
  1021.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1022.  
  1023. extern pascal ComponentResult TuneGetIndexedNoteChannel(TunePlayer tp, long i, NoteChannel *nc)
  1024.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  1025.  
  1026. /* Values for when to start. */
  1027.  
  1028. enum {
  1029.     kTuneStartNow                = 1,                            /* start after buffer is implied */
  1030.     kTuneDontClipNotes            = 2,                            /* allow notes to finish their durations outside sample */
  1031.     kTuneExcludeEdgeNotes        = 4,                            /* dont play notes that start at end of tune */
  1032.     kTuneQuickStart                = 8,                            /* Leave all the controllers where they are, ignore start time */
  1033.     kTuneLoopUntil                = 16,                            /* loop a queued tune if there's nothing else in the queue */
  1034.     kTuneStartNewMaster            = 16384
  1035. };
  1036.  
  1037. extern pascal ComponentResult TuneQueue(TunePlayer tp, unsigned long *tune, Fixed tuneRate, unsigned long tuneStartPosition, unsigned long tuneStopPosition, unsigned long queueFlags, TuneCallBackUPP callBackProc, long refCon)
  1038.  FIVEWORDINLINE(0x2F3C, 0x001C, 0x000A, 0x7000, 0xA82A);
  1039.  
  1040. extern pascal ComponentResult TuneInstant(TunePlayer tp, void *tune, long tunePosition)
  1041.  FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1042.  
  1043. extern pascal ComponentResult TuneGetStatus(TunePlayer tp, TuneStatus *status)
  1044.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1045.  
  1046. /* Values for stopping. */
  1047.  
  1048. enum {
  1049.     kTuneStopFade                = 1,                            /* do a quick, synchronous fadeout */
  1050.     kTuneStopSustain            = 2,                            /* don't silece notes */
  1051.     kTuneStopInstant            = 4,                            /* silence notes fast (else, decay them) */
  1052.     kTuneStopReleaseChannels    = 8                                /* afterwards, let the channels go */
  1053. };
  1054.  
  1055. extern pascal ComponentResult TuneStop(TunePlayer tp, long stopFlags)
  1056.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1057.  
  1058. extern pascal ComponentResult TuneSetVolume(TunePlayer tp, Fixed volume)
  1059.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  1060.  
  1061. extern pascal ComponentResult TuneGetVolume(TunePlayer tp)
  1062.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  1063.  
  1064. extern pascal ComponentResult TunePreroll(TunePlayer tp)
  1065.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  1066.  
  1067. extern pascal ComponentResult TuneUnroll(TunePlayer tp)
  1068.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  1069.  
  1070. extern pascal ComponentResult TuneSetNoteChannels(TunePlayer tp, unsigned long count, NoteChannel *noteChannelList, TunePlayCallBackUPP playCallBackProc, long refCon)
  1071.  FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  1072.  
  1073. extern pascal ComponentResult TuneSetPartTranspose(TunePlayer tp, unsigned long part, long transpose, long velocityShift)
  1074.  FIVEWORDINLINE(0x2F3C, 0x000C, 0x0015, 0x7000, 0xA82A);
  1075.  
  1076. extern pascal NoteAllocator TuneGetNoteAllocator(TunePlayer tp)
  1077.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0017, 0x7000, 0xA82A);
  1078.  
  1079. extern pascal ComponentResult TuneSetSofter(TunePlayer tp, long softer)
  1080.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  1081.  
  1082. extern pascal ComponentResult TuneTask(TunePlayer tp)
  1083.  FIVEWORDINLINE(0x2F3C, 0x0000, 0x0019, 0x7000, 0xA82A);
  1084.  
  1085. extern pascal ComponentResult TuneSetBalance(TunePlayer tp, long balance)
  1086.  FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  1087.  
  1088. typedef unsigned long MusicOpWord;
  1089. typedef unsigned long *MusicOpWordPtr;
  1090. /*
  1091.      QuickTime Music Track Event Formats:
  1092.  
  1093.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1094.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1095.     long CONTROL events, and variable GENERAL events.
  1096.  
  1097.         • REST Event (4 bytes/event):
  1098.     
  1099.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1100.         
  1101.         • Short NOTE Events (4 bytes/event):
  1102.     
  1103.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1104.         
  1105.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1106.  
  1107.         • Short CONTROL Events (4 bytes/event):
  1108.     
  1109.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1110.                                                                          ( or 15-bit Signed Value)
  1111.         • Short GENERAL Event (4 bytes/event):
  1112.     
  1113.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1114.     
  1115.         • Long NOTE Events (8 bytes/event):
  1116.     
  1117.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1118.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1119.         
  1120.         • Long CONTROL Event (8 bytes/event):
  1121.         
  1122.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1123.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1124.     
  1125.         • Long KNOB Event (8 bytes/event):
  1126.     
  1127.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1128.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1129.     
  1130.         • Variable GENERAL Length Events (N bytes/event):
  1131.     
  1132.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1133.                 :
  1134.             (32-bit Data values)
  1135.                 :
  1136.             (1 1) (14-bit UNUSED) (16-bit Length)
  1137.     
  1138.             where:    Length field is the number of LONG words in the record.
  1139.                     Lengths include the first and last long words (Minimum length = 2)
  1140.                 
  1141.     The following event type values have not been used yet and are reserved for 
  1142.     future expansion:
  1143.         
  1144.         • (1 0 0 0)        (8 bytes/event)
  1145.         • (1 1 0 0)        (N bytes/event)
  1146.         • (1 1 0 1)        (N bytes/event)
  1147.         • (1 1 1 0)        (N bytes/event)
  1148.         
  1149.     For all events, the following generalizations apply:
  1150.     
  1151.         -    All duration values are specified in Millisecond units.
  1152.         -     Pitch values are intended to map directly to the MIDI key numbers.
  1153.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1154.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1155.             Key Pressure, and Channel Pressure).    
  1156. */
  1157. /* Defines for the implemented music event data fields*/
  1158.  
  1159. enum {
  1160.     kRestEventType                = 0x00000000,                    /* lower 3-bits */
  1161.     kNoteEventType                = 0x00000001,                    /* lower 3-bits */
  1162.     kControlEventType            = 0x00000002,                    /* lower 3-bits */
  1163.     kMarkerEventType            = 0x00000003,                    /* lower 3-bits */
  1164.     kUndefined1EventType        = 0x00000008,                    /* 4-bits */
  1165.     kXNoteEventType                = 0x00000009,                    /* 4-bits */
  1166.     kXControlEventType            = 0x0000000A,                    /* 4-bits */
  1167.     kKnobEventType                = 0x0000000B,                    /* 4-bits */
  1168.     kUndefined2EventType        = 0x0000000C,                    /* 4-bits */
  1169.     kUndefined3EventType        = 0x0000000D,                    /* 4-bits */
  1170.     kUndefined4EventType        = 0x0000000E,                    /* 4-bits */
  1171.     kGeneralEventType            = 0x0000000F,                    /* 4-bits */
  1172.     kXEventLengthBits            = 0x00000002,                    /* 2 bits: indicates 8-byte event record */
  1173.     kGeneralEventLengthBits        = 0x00000003,                    /* 2 bits: indicates variable length event record */
  1174.     kEventLen                    = 1L,                            /* length of events in long words */
  1175.     kXEventLen                    = 2L,
  1176.     kRestEventLen                = kEventLen,                    /* length of events in long words */
  1177.     kNoteEventLen                = kEventLen,
  1178.     kControlEventLen            = kEventLen,
  1179.     kMarkerEventLen                = kEventLen,
  1180.     kXNoteEventLen                = kXEventLen,
  1181.     kXControlEventLen            = kXEventLen,
  1182.     kGeneralEventLen            = kXEventLen,                    /* 2 or more, however */
  1183.                                                                 /* Universal Event Defines*/
  1184.     kEventLengthFieldPos        = 30,                            /* by looking at these two bits of the 1st or last word              */
  1185.     kEventLengthFieldWidth        = 2,                            /* of an event you can determine the event length                      */
  1186.                                                                 /* length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length */
  1187.     kEventTypeFieldPos            = 29,                            /* event type field for short events */
  1188.     kEventTypeFieldWidth        = 3,                            /* short type is 3 bits */
  1189.     kXEventTypeFieldPos            = 28,                            /* event type field for extended events */
  1190.     kXEventTypeFieldWidth        = 4,                            /* extended type is 4 bits */
  1191.     kEventPartFieldPos            = 24,
  1192.     kEventPartFieldWidth        = 5,
  1193.     kXEventPartFieldPos            = 16,                            /* in the 1st long word */
  1194.     kXEventPartFieldWidth        = 12,                            /* Rest Events*/
  1195.     kRestEventDurationFieldPos    = 0,
  1196.     kRestEventDurationFieldWidth = 24,
  1197.     kRestEventDurationMax        = ((1L << kRestEventDurationFieldWidth) - 1), /* Note Events*/
  1198.     kNoteEventPitchFieldPos        = 18,
  1199.     kNoteEventPitchFieldWidth    = 6,
  1200.     kNoteEventPitchOffset        = 32,                            /* add to value in pitch field to get actual pitch */
  1201.     kNoteEventVolumeFieldPos    = 11,
  1202.     kNoteEventVolumeFieldWidth    = 7,
  1203.     kNoteEventVolumeOffset        = 0,                            /* add to value in volume field to get actual volume */
  1204.     kNoteEventDurationFieldPos    = 0,
  1205.     kNoteEventDurationFieldWidth = 11,
  1206.     kNoteEventDurationMax        = ((1L << kNoteEventDurationFieldWidth) - 1),
  1207.     kXNoteEventPitchFieldPos    = 0,                            /* in the 1st long word */
  1208.     kXNoteEventPitchFieldWidth    = 16,
  1209.     kXNoteEventDurationFieldPos    = 0,                            /* in the 2nd long word */
  1210.     kXNoteEventDurationFieldWidth = 22,
  1211.     kXNoteEventDurationMax        = ((1L << kXNoteEventDurationFieldWidth) - 1),
  1212.     kXNoteEventVolumeFieldPos    = 22,                            /* in the 2nd long word */
  1213.     kXNoteEventVolumeFieldWidth    = 7,                            /* Control Events*/
  1214.     kControlEventControllerFieldPos = 16,
  1215.     kControlEventControllerFieldWidth = 8,
  1216.     kControlEventValueFieldPos    = 0,
  1217.     kControlEventValueFieldWidth = 16,
  1218.     kXControlEventControllerFieldPos = 0,                        /* in the 2nd long word */
  1219.     kXControlEventControllerFieldWidth = 16,
  1220.     kXControlEventValueFieldPos    = 0,                            /* in the 1st long word */
  1221.     kXControlEventValueFieldWidth = 16,                            /* Knob Events*/
  1222.     kKnobEventValueHighFieldPos    = 0,                            /* 1st long word */
  1223.     kKnobEventValueHighFieldWidth = 16,
  1224.     kKnobEventKnobFieldPos        = 16,                            /* 2nd long word */
  1225.     kKnobEventKnobFieldWidth    = 14,
  1226.     kKnobEventValueLowFieldPos    = 0,                            /* 2nd long word */
  1227.     kKnobEventValueLowFieldWidth = 16,                            /* Marker Events*/
  1228.     kMarkerEventSubtypeFieldPos    = 16,
  1229.     kMarkerEventSubtypeFieldWidth = 8,
  1230.     kMarkerEventValueFieldPos    = 0,
  1231.     kMarkerEventValueFieldWidth    = 16,                            /* General Events*/
  1232.     kGeneralEventSubtypeFieldPos = 16,                            /* in the last long word */
  1233.     kGeneralEventSubtypeFieldWidth = 14,
  1234.     kGeneralEventLengthFieldPos    = 0,                            /* in the 1st & last long words */
  1235.     kGeneralEventLengthFieldWidth = 16
  1236. };
  1237.  
  1238. /* macros for extracting various fields from the QuickTime event records*/
  1239. #define qtma_MASK(bitWidth)             ((1L << (bitWidth)) - 1)
  1240. #define qtma_EXT(val, pos, width)         (((val) >> (pos)) & qtma_MASK(width))
  1241. #define qtma_EventLength(x)             ((qtma_EXT(x, kEventLengthFieldPos,     kEventLengthFieldWidth) < 2) ? 1 :     ((qtma_EXT(x, kEventLengthFieldPos, kEventLengthFieldWidth) == 2) ? 2 : qtma_EXT(x, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth)))
  1242. #define qtma_EventType(x)                 ((qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? qtma_EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  1243. #define qtma_RestDuration(x)              (qtma_EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  1244. #define qtma_Part(x)                     (qtma_EXT(x, kEventPartFieldPos, kEventPartFieldWidth))
  1245. #define qtma_XPart(m, l)                 (qtma_EXT(m, kXEventPartFieldPos, kXEventPartFieldWidth))
  1246. #define qtma_NotePitch(x)                 (qtma_EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  1247. #define qtma_NoteVolume(x)                 (qtma_EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  1248. #define qtma_NoteDuration(x)             (qtma_EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  1249. #define qtma_NoteVelocity qtma_NoteVolume
  1250. #define qtma_XNotePitch(m, l)             (qtma_EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  1251. #define qtma_XNoteVolume(m, l)             (qtma_EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  1252. #define qtma_XNoteDuration(m, l)         (qtma_EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  1253. #define qtma_XNoteVelocity qtma_XNoteVolume
  1254. #define qtma_ControlController(x)         (qtma_EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  1255. #define qtma_ControlValue(x)             (qtma_EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  1256. #define qtma_XControlController(m, l)     (qtma_EXT(l, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  1257. #define qtma_XControlValue(m, l)         (qtma_EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  1258. #define qtma_MarkerSubtype(x)            (qtma_EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  1259. #define qtma_MarkerValue(x)             (qtma_EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  1260. #define qtma_KnobValue(m,l)                ((qtma_EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16)    | (qtma_EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  1261. #define qtma_KnobKnob(m,l)                (qtma_EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  1262. #define qtma_GeneralSubtype(m,l)        (qtma_EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  1263. #define qtma_GeneralLength(m,l)           (qtma_EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  1264. #define qtma_StuffRestEvent(x, duration)                                                                x =     (kRestEventType << kEventTypeFieldPos)                                |    ((long)(duration) << kRestEventDurationFieldPos)
  1265. #define qtma_StuffNoteEvent(x, part, pitch, volume, duration)                                                x =     (kNoteEventType << kEventTypeFieldPos)                                    |     ((long)(part) << kEventPartFieldPos)                                    |    (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos)    |    (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos)    |    ((long)(duration) << kNoteEventDurationFieldPos)
  1266. #define qtma_StuffControlEvent(x, part, control, value)                                                    x =     (kControlEventType << kEventTypeFieldPos)                            |     ((long)(part) << kEventPartFieldPos)                                |    ((long)(control) << kControlEventControllerFieldPos)                |    ((long)((value) & qtma_MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos)
  1267. #define qtma_StuffMarkerEvent(x, markerType, markerValue)                                                x =     (kMarkerEventType << kEventTypeFieldPos)                            |     ((long)(markerType) << kMarkerEventSubtypeFieldPos)                    |    ((long)(markerValue) << kMarkerEventValueFieldPos)                    w1 =     (kXNoteEventType << kXEventTypeFieldPos)                            |    ((long)(part) << kXEventPartFieldPos)                                |    ((long)(pitch) << kXNoteEventPitchFieldPos),                        w2 =    (kXEventLengthBits << kEventLengthFieldPos)                            |    ((long)(duration) << kXNoteEventDurationFieldPos)                    |    ((long)(volume) << kXNoteEventVolumeFieldPos)
  1268. #define qtma_StuffXControlEvent(w1, w2, part, control, value)                                            w1 =     (kXControlEventType << kXEventTypeFieldPos)                            |    ((long)(part) << kXEventPartFieldPos)                                |    ((long)((value) & qtma_MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos), w2 =    (kXEventLengthBits << kEventLengthFieldPos)                            |    ((long)(control) << kXControlEventControllerFieldPos)
  1269. #define qtma_StuffKnobEvent(w1, w2, part, knob, value)                                                w1 =    (kKnobEventType << kXEventTypeFieldPos)                            |    ((long)(part) << kXEventPartFieldPos)                            |    ((long)(value >> 16) << kKnobEventValueLowFieldPos),            w2 =    (kXEventLengthBits << kEventLengthFieldPos)                        |    ((long)(knob) << kKnobEventKnobFieldPos)                        |    ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos)
  1270. #define qtma_StuffGeneralEvent(w1,w2,part,subType,length)                                            w1 =    (kGeneralEventType << kXEventTypeFieldPos)                        |    ((long)(part) << kXEventPartFieldPos)                            |    ((long)(length) << kGeneralEventLengthFieldPos),                w2 =    (kGeneralEventLengthBits << kEventLengthFieldPos)                |    ((long)(subType) << kGeneralEventSubtypeFieldPos)                |    ((long)(length) << kGeneralEventLengthFieldPos)
  1271. /* General Event Defined Types*/
  1272.  
  1273. enum {
  1274.     kGeneralEventNoteRequest    = 1,                            /* Encapsulates NoteRequest data structure */
  1275.     kGeneralEventPartKey        = 4,
  1276.     kGeneralEventTuneDifference    = 5,                            /* Contains a standard sequence, with end marker, for the tune difference of a sequence piece */
  1277.     kGeneralEventAtomicInstrument = 6,                            /* Encapsulates AtomicInstrument record */
  1278.     kGeneralEventKnob            = 7,                            /* knobID/knobValue pairs; smallest event is 4 longs */
  1279.     kGeneralEventMIDIChannel    = 8                                /* used in tune header, one longword identifies the midi channel it originally came from */
  1280. };
  1281.  
  1282. /* Marker Event Defined Types        // marker is 60 ee vv vv in hex, where e = event type, and v = value*/
  1283.  
  1284. enum {
  1285.     kMarkerEventEnd                = 0,                            /* marker type 0 means: value 0 - stop, value != 0 - ignore*/
  1286.     kMarkerEventBeat            = 1,                            /* value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note)*/
  1287.     kMarkerEventTempo            = 2                                /* value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export*/
  1288. };
  1289.  
  1290. /* UPP call backs */
  1291.  
  1292. #if GENERATINGCFM
  1293. #else
  1294. #endif
  1295.  
  1296. enum {
  1297.     uppMusicMIDISendProcInfo = kPascalStackBased
  1298.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  1299.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(MusicComponent)))
  1300.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1301.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(MusicMIDIPacket *))),
  1302.     uppMusicMIDIReadHookProcInfo = kPascalStackBased
  1303.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  1304.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(MusicMIDIPacket *)))
  1305.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  1306.     uppMusicOfflineDataProcInfo = kPascalStackBased
  1307.          | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  1308.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Ptr)))
  1309.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1310.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long))),
  1311.     uppTuneCallBackProcInfo = kPascalStackBased
  1312.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(const TuneStatus *)))
  1313.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long))),
  1314.     uppTunePlayCallBackProcInfo = kPascalStackBased
  1315.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(unsigned long *)))
  1316.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  1317.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(long)))
  1318. };
  1319.  
  1320. #if GENERATINGCFM
  1321. #define NewMusicMIDISendProc(userRoutine)        \
  1322.         (MusicMIDISendUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture())
  1323. #define NewMusicMIDIReadHookProc(userRoutine)        \
  1324.         (MusicMIDIReadHookUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, GetCurrentArchitecture())
  1325. #define NewMusicOfflineDataProc(userRoutine)        \
  1326.         (MusicOfflineDataUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, GetCurrentArchitecture())
  1327. #define NewTuneCallBackProc(userRoutine)        \
  1328.         (TuneCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture())
  1329. #define NewTunePlayCallBackProc(userRoutine)        \
  1330.         (TunePlayCallBackUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture())
  1331. #else
  1332. #define NewMusicMIDISendProc(userRoutine)        \
  1333.         ((MusicMIDISendUPP) (userRoutine))
  1334. #define NewMusicMIDIReadHookProc(userRoutine)        \
  1335.         ((MusicMIDIReadHookUPP) (userRoutine))
  1336. #define NewMusicOfflineDataProc(userRoutine)        \
  1337.         ((MusicOfflineDataUPP) (userRoutine))
  1338. #define NewTuneCallBackProc(userRoutine)        \
  1339.         ((TuneCallBackUPP) (userRoutine))
  1340. #define NewTunePlayCallBackProc(userRoutine)        \
  1341.         ((TunePlayCallBackUPP) (userRoutine))
  1342. #endif
  1343.  
  1344. #if GENERATINGCFM
  1345. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)        \
  1346.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicMIDISendProcInfo, (self), (refCon), (mmp))
  1347. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  1348.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, (mp), (myRefCon))
  1349. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon)        \
  1350.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, (SoundData), (numBytes), (myRefCon))
  1351. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  1352.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTuneCallBackProcInfo, (status), (refCon))
  1353. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)        \
  1354.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, (event), (seed), (refCon))
  1355. #else
  1356. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)        \
  1357.         (*(userRoutine))((self), (refCon), (mmp))
  1358. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)        \
  1359.         (*(userRoutine))((mp), (myRefCon))
  1360. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon)        \
  1361.         (*(userRoutine))((SoundData), (numBytes), (myRefCon))
  1362. #define CallTuneCallBackProc(userRoutine, status, refCon)        \
  1363.         (*(userRoutine))((status), (refCon))
  1364. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)        \
  1365.         (*(userRoutine))((event), (seed), (refCon))
  1366. #endif
  1367.  
  1368. /* selectors for component calls */
  1369. enum {
  1370.     kMusicGetDescriptionSelect                        = 0x0001,
  1371.     kMusicGetPartSelect                                = 0x0002,
  1372.     kMusicSetPartSelect                                = 0x0003,
  1373.     kMusicSetPartInstrumentNumberSelect                = 0x0004,
  1374.     kMusicGetPartInstrumentNumberSelect                = 0x0005,
  1375.     kMusicStorePartInstrumentSelect                    = 0x0006,
  1376.     kMusicGetPartAtomicInstrumentSelect                = 0x0009,
  1377.     kMusicSetPartAtomicInstrumentSelect                = 0x000A,
  1378.     kMusicGetInstrumentKnobDescriptionObsoleteSelect = 0x000D,
  1379.     kMusicGetDrumKnobDescriptionObsoleteSelect        = 0x000E,
  1380.     kMusicGetKnobDescriptionObsoleteSelect            = 0x000F,
  1381.     kMusicGetPartKnobSelect                            = 0x0010,
  1382.     kMusicSetPartKnobSelect                            = 0x0011,
  1383.     kMusicGetKnobSelect                                = 0x0012,
  1384.     kMusicSetKnobSelect                                = 0x0013,
  1385.     kMusicGetPartNameSelect                            = 0x0014,
  1386.     kMusicSetPartNameSelect                            = 0x0015,
  1387.     kMusicFindToneSelect                            = 0x0016,
  1388.     kMusicPlayNoteSelect                            = 0x0017,
  1389.     kMusicResetPartSelect                            = 0x0018,
  1390.     kMusicSetPartControllerSelect                    = 0x0019,
  1391.     kMusicGetPartControllerSelect                    = 0x001A,
  1392.     kMusicGetMIDIProcSelect                            = 0x001B,
  1393.     kMusicSetMIDIProcSelect                            = 0x001C,
  1394.     kMusicGetInstrumentNamesSelect                    = 0x001D,
  1395.     kMusicGetDrumNamesSelect                        = 0x001E,
  1396.     kMusicGetMasterTuneSelect                        = 0x001F,
  1397.     kMusicSetMasterTuneSelect                        = 0x0020,
  1398.     kMusicGetInstrumentAboutInfoSelect                = 0x0022,
  1399.     kMusicGetDeviceConnectionSelect                    = 0x0023,
  1400.     kMusicUseDeviceConnectionSelect                    = 0x0024,
  1401.     kMusicGetKnobSettingStringsSelect                = 0x0025,
  1402.     kMusicGetMIDIPortsSelect                        = 0x0026,
  1403.     kMusicSendMIDISelect                            = 0x0027,
  1404.     kMusicReceiveMIDISelect                            = 0x0028,
  1405.     kMusicStartOfflineSelect                        = 0x0029,
  1406.     kMusicSetOfflineTimeToSelect                    = 0x002A,
  1407.     kMusicGetInstrumentKnobDescriptionSelect        = 0x002B,
  1408.     kMusicGetDrumKnobDescriptionSelect                = 0x002C,
  1409.     kMusicGetKnobDescriptionSelect                    = 0x002D,
  1410.     kMusicGetInfoTextSelect                            = 0x002E,
  1411.     kMusicGetInstrumentInfoSelect                    = 0x002F,
  1412.     kMusicTaskSelect                                = 0x0031,
  1413.     kMusicGenericConfigureSelect                    = 0x0100,
  1414.     kMusicGenericGetPartSelect                        = 0x0101,
  1415.     kMusicGenericGetKnobListSelect                    = 0x0102,
  1416.     kMusicDerivedMIDISendSelect                        = 0x0200,
  1417.     kMusicDerivedSetKnobSelect                        = 0x0201,
  1418.     kMusicDerivedSetPartSelect                        = 0x0202,
  1419.     kMusicDerivedSetInstrumentSelect                = 0x0203,
  1420.     kMusicDerivedSetPartInstrumentNumberSelect        = 0x0204,
  1421.     kMusicDerivedSetMIDISelect                        = 0x0205,
  1422.     kMusicDerivedStorePartInstrumentSelect            = 0x0206,
  1423.     kInstrumentGetInstSelect                        = 0x0001,
  1424.     kInstrumentGetInfoSelect                        = 0x0002,
  1425.     kInstrumentInitializeSelect                        = 0x0003,
  1426.     kInstrumentOpenComponentResFileSelect            = 0x0004,
  1427.     kInstrumentCloseComponentResFileSelect            = 0x0005,
  1428.     kInstrumentGetComponentRefConSelect                = 0x0006,
  1429.     kInstrumentSetComponentRefConSelect                = 0x0007,
  1430.     kNARegisterMusicDeviceSelect                    = 0x0000,
  1431.     kNAUnregisterMusicDeviceSelect                    = 0x0001,
  1432.     kNAGetRegisteredMusicDeviceSelect                = 0x0002,
  1433.     kNASaveMusicConfigurationSelect                    = 0x0003,
  1434.     kNANewNoteChannelSelect                            = 0x0004,
  1435.     kNADisposeNoteChannelSelect                        = 0x0005,
  1436.     kNAGetNoteChannelInfoSelect                        = 0x0006,
  1437.     kNAPrerollNoteChannelSelect                        = 0x0007,
  1438.     kNAUnrollNoteChannelSelect                        = 0x0008,
  1439.     kNASetNoteChannelVolumeSelect                    = 0x000B,
  1440.     kNAResetNoteChannelSelect                        = 0x000C,
  1441.     kNAPlayNoteSelect                                = 0x000D,
  1442.     kNASetControllerSelect                            = 0x000E,
  1443.     kNASetKnobSelect                                = 0x000F,
  1444.     kNAFindNoteChannelToneSelect                    = 0x0010,
  1445.     kNASetInstrumentNumberSelect                    = 0x0011,
  1446.     kNAPickInstrumentSelect                            = 0x0012,
  1447.     kNAPickArrangementSelect                        = 0x0013,
  1448.     kNAGetStatusBlockSelect                            = 0x0014,
  1449.     kNASetDefaultMIDIInputSelect                    = 0x0015,
  1450.     kNAGetDefaultMIDIInputSelect                    = 0x0016,
  1451.     kNAUseDefaultMIDIInputSelect                    = 0x0019,
  1452.     kNALoseDefaultMIDIInputSelect                    = 0x001A,
  1453.     kNAStuffToneDescriptionSelect                    = 0x001B,
  1454.     kNACopyrightDialogSelect                        = 0x001C,
  1455.     kNAGetMIDIPortsSelect                            = 0x0021,
  1456.     kNAGetNoteRequestSelect                            = 0x0022,
  1457.     kNASendMIDISelect                                = 0x0023,
  1458.     kNAPickEditInstrumentSelect                        = 0x0024,
  1459.     kNANewNoteChannelFromAtomicInstrumentSelect        = 0x0025,
  1460.     kNASetAtomicInstrumentSelect                    = 0x0026,
  1461.     kNAGetKnobSelect                                = 0x0028,
  1462.     kNATaskSelect                                    = 0x0029,
  1463.     kNASetNoteChannelBalanceSelect                    = 0x002A,
  1464.     kTuneSetHeaderSelect                            = 0x0004,
  1465.     kTuneGetTimeBaseSelect                            = 0x0005,
  1466.     kTuneSetTimeScaleSelect                            = 0x0006,
  1467.     kTuneGetTimeScaleSelect                            = 0x0007,
  1468.     kTuneGetIndexedNoteChannelSelect                = 0x0008,
  1469.     kTuneQueueSelect                                = 0x000A,
  1470.     kTuneInstantSelect                                = 0x000B,
  1471.     kTuneGetStatusSelect                            = 0x000C,
  1472.     kTuneStopSelect                                    = 0x000D,
  1473.     kTuneSetVolumeSelect                            = 0x0010,
  1474.     kTuneGetVolumeSelect                            = 0x0011,
  1475.     kTunePrerollSelect                                = 0x0012,
  1476.     kTuneUnrollSelect                                = 0x0013,
  1477.     kTuneSetNoteChannelsSelect                        = 0x0014,
  1478.     kTuneSetPartTransposeSelect                        = 0x0015,
  1479.     kTuneGetNoteAllocatorSelect                        = 0x0017,
  1480.     kTuneSetSofterSelect                            = 0x0018,
  1481.     kTuneTaskSelect                                    = 0x0019,
  1482.     kTuneSetBalanceSelect                            = 0x001A
  1483. };
  1484.  
  1485. #if PRAGMA_ALIGN_SUPPORTED
  1486. #pragma options align=reset
  1487. #endif
  1488.  
  1489. #if PRAGMA_IMPORT_SUPPORTED
  1490. #pragma import off
  1491. #endif
  1492.  
  1493. #ifdef __cplusplus
  1494. }
  1495. #endif
  1496.  
  1497. #endif /* __QUICKTIMEMUSIC__ */
  1498.  
  1499.